<?php
class AES
{
    /**
     * 加密
     */
    public static function encrypt($data,$key,$iv,$method = 'AES-128-CBC')
    {
        return base64_encode(openssl_encrypt($data,$method,$key,1 ,$iv));
    }

    /**
     * 随机字符串
     */
    public static function generatorRandomStr($len = 16)
    {
        return substr(uniqid('t',1),0,$len);
    }
}